﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CompositePattern.DemoOne
{
    public class Leaf : ILeaf
    {
        private string name = "";
        private string position = "";
        private int salary = 0;

        public Leaf(string name, string position, int salary)
        {
            this.name = name;
            this.position = position;
            this.salary = salary;
        }
        
        public string getInfo()
        {
            string info = string.Empty;
            info = "name:" + this.name + Environment.NewLine;
            info += "position:" + this.position + Environment.NewLine;//职位
            info += "salary:" + this.salary + Environment.NewLine; //薪水
            return info;
        }

    }
}
